package net.wang.boot.order.service;

import com.alibaba.dubbo.config.annotation.Reference;
import lombok.extern.slf4j.Slf4j;
import net.wang.gmall.domain.UserAddress;
import net.wang.gmall.service.IOrderService;
import net.wang.gmall.service.IUserService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 1,将服务提供者注册到注册中心
 * 2,让服务消费者去注册中心订阅提供者的服务地址
 */
@Slf4j
@Service
public class OrderService implements IOrderService {

    @Reference //依赖dubbo暴露的服务
    private IUserService userService;

    @Override
    public List<UserAddress> initOrder(String uuid) {
        log.info("uuid = {}", uuid);
        //1,获取用户收货地址
        return userService.getUserAddressList("1a");
    }
}
